<template>
  <div id="container"></div>
</template>

<script>
import * as THREE from 'three'
import { SceneBasic } from './js/scene-basic.js'
export default {
  mounted() {
    const sceneBasic = new SceneBasic()
    //创建纹理
    //导入纹理
    const textureLoader = new THREE.TextureLoader()
    const img = require('./material/static/baite.png')
    const logo = textureLoader.load(img)
    console.log(logo)
    //创建球体
    const spherome = new THREE.SphereGeometry(40, 64, 64)
    const material = new THREE.MeshPhongMaterial({
      map: logo,
    })
    const cube = new THREE.Mesh(spherome, material)
    sceneBasic.scene.add(cube)
    sceneBasic.scene.remove(sceneBasic.axes)
    //添加环境光
    // var ambient = new THREE.AmbientLight(0xffffff)
    // console.log(ambient)
    // sceneBasic.scene.add(ambient) //环境光对象添加到scene场景中
    const point = new THREE.PointLight(0x0fd49b)
    point.position.set(0, 500, 0)
    sceneBasic.scene.add(point)
    sceneBasic.render()
  },
}
</script>

<style></style>
